package com.sky.common.generate;


import com.sky.common.generate.core.*;

import java.util.ArrayList;
import java.util.List;

public class GenerateRun {

    public static void main(String[] args) {
        // 数据库配置
        GenerateConfig.jdbcUrl = "jdbc:mysql://127.0.0.1:3306/test";
        GenerateConfig.jdbcUserName = "root";
        GenerateConfig.jdbcPassword = "123456";

        //强制覆盖已存在的类  (true 是 | false 否)
        GenerateConfig.isCoverage = false;

        String packagePath = "com.sky.codeGenerate.modules";

        List<GenerateBase> list = new ArrayList<>();
        // 表名,包名,类名
        list.add(new GenerateBase("ui_user_info", "userInfo", "UserInfo"));

        // 执行生成方法
        for (GenerateBase base : list) {
            base.setPackagePath(packagePath);
            // 生成Api
            // new GenerateApi(base).execute();
            // 生成Controller
            new GenerateController(base).execute();
            // 生成Service
            new GenerateService(base).execute();
            // 生成Mapper
            new GenerateMapper(base).execute();
            // 生成 XML
            new GenerateXML(base).execute();
            // 生成实体
            new GenerateEntity(base).execute();
        }
    }

}
